<table>
    <tr>
        <th>Id</th>
        <th>username</th>
        <th>group id</th>
		<th>Accion</th>
    </tr>

    <!-- Here is where we loop through our $posts array, printing out post info -->

    <?php foreach ($users as $user): ?>
    <tr>
        <td><?php echo $user['User']['id']; ?></td>
        <td>
	        <?php echo $this->Html->link($user['User']['username'], array(
																'controller' => 'users', 
																'action' => 'view', 
																$user['User']['id'])); ?>
    	</td>
        <td><?php echo $user['User']['group_id']; ?></td>
		<td>
            <?php echo $this->Html->link('Edit', array('action' => 'edit', $user['User']['id']));?>
        </td>
    </tr>
    <?php endforeach; ?>

</table>
<?php echo $this->Html->link('logout', array('controller' => 'users', 
																'action' => 'logout')); ?>
<div class="users form">
<?php echo $this->Form->create('User', array('action' => 'add'));?>
    <fieldset>
        <legend><?php echo __('Add User'); ?></legend>
    <?php
        echo $this->Form->input('username');
        echo $this->Form->input('password');
        echo $this->Form->input('group_id');
    ?>
    </fieldset>
<?php echo $this->Form->end(__('Submit'));?>
</div>

<div class="users form">
<?php echo $this->Session->flash('auth'); ?>
<?php echo $this->Form->create('User', array('action' => 'login'));?>
    <fieldset>
        <legend><?php echo __('Please enter your username and password'); ?></legend>
    <?php
        echo $this->Form->input('username');
        echo $this->Form->input('password');
    ?>
    </fieldset>
<?php echo $this->Form->end(__('Login'));?>
</div>